﻿using Basic.FormGatewaryModular.Interface;
using Basic.FormRemoteModel.QueryTable;
using Basic.FormRemoteModel.QueryTable.Model;

namespace Basic.FormGatewaryModular.Services
{
    internal class PhyQueryTableService : IPhyQueryTableService
    {
        public long Add ( PhyQueryTableAdd add )
        {
            return new AddPhyQueryTable
            {
                Datum = add
            }.Send();
        }

        public void Delete ( long id )
        {
            new DeletePhyQueryTable
            {
                Id = id
            }.Send();
        }

        public PhyQueryTableData Get ( long id )
        {
            return new GetPhyQueryTable
            {
                Id = id
            }.Send();
        }

        public bool Set ( long id, PhyQueryTableSet data )
        {
            return new SetPhyQueryTable
            {
                Id = id,
                Datum = data
            }.Send();
        }
        public PhyQueryCol[] GetCols ( long id )
        {
            return new GetPhyQueryTableCol
            {
                Id = id
            }.Send();
        }
        public PhyQueryTableBody[] Gets ( long formId, bool isHidden )
        {
            return new GetPhyQueryForm
            {
                FormId = formId,
                IsHidden = isHidden
            }.Send();
        }
    }
}
